Removes all leading spaces at the start of a string expression.
文字列表式の先頭部にあるスペース記号を、すべて削除します。
LTrim (Text As String)
LTrim (Text As String)
String
文字列
Text: Any string expression.
Text: 処理をする文字列表現。
Use this function to remove spaces at the beginning of a string expression.
この関数は、文字列表式の先頭部にあるスペース記号を削除します。
Sub ExampleSpaces
Sub ExampleSpaces
Dim sText2 As String,sText As String,sOut As String
Dim sText2 As String,sText As String,sOut As String
sText2 = " <*Las Vegas*> "
sText2 = " <*Las Vegas*> "
sOut = "'"+sText2 +"'"+ Chr(13)
sOut = "'"+sText2 +"'"+ Chr(13)
sText = Ltrim(sText2) REM sText = "<*Las Vegas*> "
sText = Ltrim(sText2) REM sText = "<*Las Vegas*> "
sOut = sOut + "'"+sText +"'" + Chr(13)
sOut = sOut + "'"+sText +"'" + Chr(13)
sText = Rtrim(sText2) REM sText = " <*Las Vegas*>"
sText = Rtrim(sText2) REM sText = " <*Las Vegas*>"
sOut = sOut +"'"+ sText +"'" + Chr(13)
sOut = sOut + "'"+sText +"'" + Chr(13)
sText = Trim(sText2) REM sText = "<*Las Vegas*>"
sText = Trim(sText2) REM sText = " <*Las Vegas*> "
sOut = sOut +"'"+ sText +"'"
sOut = sOut +"'"+ sText +"'"
MsgBox sOut
MsgBox sOut
end sub
end sub